#include<iostream>
using namespace std;
class widget
{
private:
    static int count;
public:
    widget(){
        ++count;
    }
    ~widget(){
        --count;
    }
    static int num(){
        return count;
    }
};

int widget::count = 0;

int main(){
    widget x, y;
    cout << "the num is " << widget::num << endl;
    if(widget::num() > 1){
        widget x, y, z;
        cout << "the num is " << widget::num() << endl;
    }
    widget z;
    cout << "the num is " << widget::num() << endl;
    return 0;
}
